import MenuConfig from '@/router/menu'
// 获取频道下面的二级菜单
export default (id) => {
    const arr = []
    for (const c of MenuConfig) {
        const { tid, sub, hide } = c
        if (id === tid) {
            if (hide) {
                continue
            }
            arr.push({
                title: '推荐',
                tid: tid,
                path: `/channel/${tid}`
            })
            for (const subConfig of sub) {
                const subTid = subConfig.tid
                const subHide = subConfig.hide
                const subName = subConfig.name
                if (!subHide) {
                    arr.push({
                        title: subName,
                        tid: subTid,
                        path: `/channel/${tid}/${subTid}`
                    })
                }
            }
            break
        }
    }
    return arr
}